<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
	
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Snake</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script type="text/javascript">

function register()
{
	$("#form3").submit();
}

function guest()
{
	$("#form2").submit();
}

</script>

</head>
<body>

	<form id ="form1" action="login.do" method="POST">
		<fieldset style="width: 300px;">
			<legend>Log in</legend>

			<label>Username:</label> <input type="text" name="username"
				id="username" />
				<br><br>
			<div style="clear: both;"></div>

			<label>Password:</label> <input type="password" name="password"
				id="password" />
			<div style="clear: both;"></div>

			<br>
			<input type="submit" value="Connect" />
			<input type="button" value="Log in as Guest" onclick="guest()"/>
			<input type="button" value="Register" onclick="register()"/>
		</fieldset>
	</form>
	
	<form id ="form2" action="loginGuest.do">
	</form>
	
	<form id ="form3" action="register.do">
	</form>
	
	
	<br>
	<%
		String loginError = (String) session.getAttribute("badLogin");
		if (loginError != "" && loginError != null) 
		{
	%>

	<p style="color: red"><%=loginError%></p>
	<%
		}
	%>


</body>
</html>